#include"comm.hpp"

int main()
{
    key_t k=getKey();
    printf("key: 0x%x\n",k);
    int shmid=createShm(k);
    printf("shmid: %d\n",shmid);

    //sleep(5);

    //关联
    char* start=(char*)attachShm(shmid);
    printf("Attach sucess,address start: %p\n",start);
  

    while(true)
    {
        printf("Client say: %s\n",start);
        sleep(1);
    }

    //去关联
    detachShm(start);
    sleep(10);

    delShm(shmid);

    return 0;
}